from import_export.widgets import ForeignKeyWidget
from apps.pms.models import Module


class ModuleForeignKeyWidget(ForeignKeyWidget):
    def get_queryset(self, value, row, *args, **kwargs):
        return Module.objects.filter(name=row["module"], product__name=row["product"])
